DECLARE @major_version INT =
	@@MICROSOFTVERSION / POWER(2, 24);

SELECT
	st.text,
    qp.query_plan
FROM (
    SELECT TOP 50 *
    FROM sys.dm_exec_query_stats
    ORDER BY total_worker_time DESC
) AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS st
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp
WHERE qp.query_plan.value('declare namespace p="http://schemas.microsoft.com/sqlserver/2004/07/showplan"; min(//p:StmtSimple/@CardinalityEstimationModelVersion)', 'int') < @major_version * 10
OPTION (RECOMPILE);